package thread;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 苏西西
 * Date: 2023-08-25
 * Time: 16:07
 */

class N_Thread extends Thread{
    @Override
    public void run() {
        while(true){
            System.out.println("helloNThread");
            try {
                Thread.sleep(1000);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
}
public class ThreadD1 {
    public static void main(String[] args) {
        Thread thread =new N_Thread();
        thread.start();
        while(true){
            System.out.println("主线程");
            try {
                Thread.sleep(1000);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
}
